
// 获取表单数据并转换成对象格式
function serializeToJson(form) {
    var result = {};
    //serializeArray得到数组[{name:'',value:''}]
    var f = form.serializeArray();
    //转换成对象
    
    f.forEach((item) => {
        // result.email = value
        result[item.name] = item.value;
    });
    return result;
}